home *** CD-ROM | disk | FTP | other *** search
/ Internet Surfer: Getting Started / Internet Surfer - Getting Started (Wayzata Technology)(7231)(1995).bin / pc / mac / bonus / peter_le / dehqx-20 / domenus.p < prev    next >
Text File  |  1991-08-23  |  1KB  |  64 lines

  1. unit DoMenus;
  2. { DeHQX v2.0.0 ⌐ Peter Lewis, Aug 1991 }
  3.  
  4. interface
  5.  
  6.     uses
  7.         MyTypes, MyUtilities, MyLists, AppGlobals, MyFileSystem, MyMenus, MyMainLoop, Preferences;
  8.  
  9.     procedure InitMenus (dodehqx: ptr);
  10.     procedure SetMenus;
  11.     procedure DoMenu (m, i: integer);
  12.  
  13. implementation
  14.  
  15.     var
  16.         dodehqxp: ptr;
  17.  
  18.     procedure CallProc (p: ptr);
  19.     inline
  20.         $205F, $4E90;
  21.  
  22.     procedure DoMenu (m, i: integer);
  23.     begin
  24.         if SimpleDoMenu(m, i) then
  25.             case m of
  26.                 M_File: 
  27.                     case i of
  28.                         M_Preferences: 
  29.                             OpenPreferences;
  30.                         M_Close: 
  31.                             if (FrontWindow = prefs_dialog) and (prefs_dialog <> nil) then
  32.                                 ClosePreferences;
  33.                         M_DeHQX: 
  34.                             CallProc(dodehqxp);
  35.                         M_Quit: 
  36.                             quitNow := true;
  37.                         otherwise
  38.                             ;
  39.                     end;
  40.                 otherwise
  41.                     ;
  42.             end;
  43.         if not quitNow then
  44.             HiliteMenu(0);
  45.     end;
  46.  
  47.     procedure SetMenus;
  48.         var
  49.             fw: windowPtr;
  50.     begin
  51.         SimpleSetMenus;
  52.         fw := FrontWindow;
  53.         SetItemEnable(GetMenu(M_File), M_Preferences, (fw = nil) or (fw <> prefs_dialog));
  54.     end;
  55.  
  56.     procedure InitMenus (dodehqx: ptr);
  57.     begin
  58.         dodehqxp := dodehqx;
  59.         SimpleInitMenus(M_Help, M_Close, GetGlobalString(help_menu_text));
  60.         SetMenus;
  61.         DrawMenuBar;
  62.     end;
  63.  
  64. end.